package com.imooc.mall.exception;

/**
 * 异常枚举
 */
public enum ImoocMallExceptionEnum {

    NEED_USER_NAME(10001, "用户名不能为空"),
    NEED_PASSWORD(10002, "密码不能为空"),
    PASSWORD_TOO_SHORT(10003, "密码不能少于 8 位"),
    NAME_EXISTED(10004, "不允许重名"),
    INSERT_FAILED(10005, "插入失败，请重试"),
    PASSWORD_ERROR(10006, "密码错误"),
    NEED_LOGIN(10007, "用户未登录"),
    UPDATE_FAILED(10008, "更新失败"),
    IS_ADMIN(10009, "无管理员权限"),
    NAME_NOT_NULL(10010, "名字不能为空"),
    PARAMS_NOT_NULL(10011, "名字不能为空"),
    CREATE_FAILED(10012, "新增失败"),
    REQEUEST_PARAMS_ERROR(10013, "参数错误"),
    DELETE_FAILED(10014, "删除失败"),
    MAKE_DIR_FAILED(10015, "目录创建失败"),
    UPLOAD_FAILED(10016, "文件上传失败"),


    SYS_ERROR(20000, "系统异常");


    /*异常码*/
    Integer code;

    /*异常信息*/
    String msg;

    ImoocMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
